package com.zhentao.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhentao.dto.PunishDto;
import com.zhentao.mapper.PunishTypeMapper;
import com.zhentao.pojo.PunishType;
import com.zhentao.service.PunishTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author hp
* @description 针对表【punish_type】的数据库操作Service实现
* @createDate 2025-07-09 15:20:23
*/
@Service
public class PunishTypeServiceImpl extends ServiceImpl<PunishTypeMapper, PunishType>
    implements PunishTypeService{
    @Autowired
    private PunishTypeMapper punishTypeMapper;
    @Override
    public Page<PunishType> findPunishType(PunishDto punishDto) {
        Page<PunishType> page = new Page<>(punishDto.getCurrent(),punishDto.getSize());
        QueryWrapper<PunishType> wrapper = new QueryWrapper<>();
        wrapper.like(punishDto.getPunishName()!=null,"punish_name",punishDto.getPunishName());
        punishTypeMapper.selectPage(page,wrapper);
        return page;
    }
}




